package io.github.kouleen.manager.listener.player;

import io.github.kouleen.minecraft.core.lang.annotation.MinecraftPluginListener;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerTeleportEvent;

/**
 * 玩家传送事件
 * @author zhangqing
 * @since 2025/2/26 10:58
 */
@MinecraftPluginListener
public class PlayerTeleportListener implements Listener {

    @EventHandler
    public void onPlayerTeleportListener(PlayerTeleportEvent playerTeleportEvent){
        Player player = playerTeleportEvent.getPlayer();
        System.out.println(player.getName() + " 触发了传送");
        Location locationFrom = playerTeleportEvent.getFrom();
        Location locationTo = playerTeleportEvent.getTo();
        PlayerTeleportEvent.TeleportCause playerTeleportEventCause = playerTeleportEvent.getCause();

    }
}
